import instance from './index.js'

// 获取文章
export function getnewslist(page,pagesize) {
    
    return instance.get(`http://api.w0824.com/api/getnewslist?page=${page}&pagesize=${pagesize}`)
    
 }

//  获取文章详情
 export function getnewdetails(id) {
    
    return instance.get(`http://api.w0824.com/api/getnew/${id}`)
    
 }

 
// 获取评论数据
 export function getnewcomments(id,pagesize,pageindex) {
    
   return instance.get(`http://api.w0824.com/api/getcomments/${id}?pagasize=${pagesize}&pageindex=${pageindex}`)
   
}


// 发布评论
export function postcomment(id,content) {
    
   return instance.post('http://api.w0824.com/api/postcomment/14', {
      news_id: id,
      content: content,
    })
   
}

